1. Field of the Invention
The present invention relates to a portable electronic device such as an IC card for executing a variety of processings in response to instruction data supplied from an external device.
2. Description of the Related Art
In recent years, for example, an IC card has been practically used as a portable electronic device. The ID card has: a nonvolatile memory capable of writing and rewriting data, a control element, an interface for making communication with an external device, and the like.
Such an IC card has an advantage that a plurality of application programs can be maintained in one IC card. That is, a plurality of functions such as a cash card, an ID card for personal authentication, and a prepaid card can be achieved by one IC card. In such an IC card having a plurality functions, applications and data required for operating each of the functions are stored in a nonvolatile memory in a file format on an application by application basis.
In addition, the IC card carries out a variety of processings according to an instruction (command) from an external device. Therefore, the IC card selects a file (application) in accordance with the command from the external device, and executes a variety of processings. In general, data to be stored in the nonvolatile memory incorporated in the IC card is stored in the form which consists of an identifier (tag), a data length (length), and a data value (value). Thus, in the IC card, it is possible to provide an access (readout, addition, rewriting, and deletion) or the like to specified data, based on the tag specified by a command.
However, some of the data to be stored in the memory incorporated in the IC card has a nest structure. For example, in ISO/IEC 7816-4 Annex. D, a structured tag field is defined as an example of the data having the nest structure. Such data having the nest structure has a problem that a direct access cannot be provided to data which exists in a certain type of data. For example, in a conventional IC card, there is a problem that, in the case where a plurality of second hierarchy data exist in first hierarchy data, a direct access cannot be provided to the second hierarchy data.